#ifndef _DES_3DES_H
#define _DES_3DES_H
/* 
 *  $Id: des.h,v 1.1 2002/09/26 01:53:59 leon Exp $
 */   

#ifndef byte
typedef unsigned char byte;
#endif

#ifndef u32
typedef unsigned int u32;
#endif

/*
 * Encryption/Decryption context of DES
 */
typedef struct _des_ctx
  {
    u32 encrypt_subkeys[32];
    u32 decrypt_subkeys[32];
  }
des_ctx[1];

/*
 * Encryption/Decryption context of Triple-DES
 */
typedef struct _tripledes_ctx
  {
    u32 encrypt_subkeys[96];
    u32 decrypt_subkeys[96];
  }
tripledes_ctx[1];

#ifdef __cplusplus
extern "C" {
#endif

int cldes_setkey (struct _des_ctx *, const byte *);
int des_ecb_crypt (struct _des_ctx *, const byte *, byte *, int);
int tripledes_set2keys (struct _tripledes_ctx *, const byte *, const byte *);
int tripledes_set3keys (struct _tripledes_ctx *, const byte *, const byte *, const byte *);
int tripledes_ecb_crypt (struct _tripledes_ctx *, const byte *, byte *, int);
int is_weak_key ( const byte *key );

#ifdef __cplusplus
}
#endif

#endif



